<template>
	<view class="container">		
		<uni-fab ref="fab" :pattern="pattern" :content="content" :horizontal="fabStyle.horizontal" :vertical="fabStyle.vertical"
			:direction="fabStyle.direction" @trigger="trigger"/>
	</view>
</template>

<script>
	export default {
		components: {},
		name:"vfab",
		props:["fabStyle","vmenu"],
		data() {
			return {							
				pattern: {
					color: '#007AFF',
					backgroundColor: '#fff',
					selectedColor: '#007AFF',
					buttonColor: '#007AFF',
					iconColor: '#fff'
				},
				is_color_type: false,
				content: [...this.vmenu]
			}
		},
		methods: {
			trigger(e) {
				this.content[e.index].active = !e.item.active		
				this.$emit("vtrigger",{isActive:e.item.active,index:e.index,content:e.item.text});
				// this.$refs.fab.close()
			},
			fabClick() {				
				// uni.showToast({
				// 	title: '点击了悬浮按钮',
				// 	icon: 'none'
				// })
			},
			
		}
	}
</script>

<style lang="scss">
	.warp {
		padding: 10px;
	}

	.button {
		margin-bottom: 10px;
	}
</style>